<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue</title>
</head>
<script src="vue.js"></script>
<script src="node_modules/axios/dist/axios.js"></script>
<script src="node_modules/lodash/lodash.js"></script>
<body>

    <div id="app">
        <input type="text" v-model="word">
        <h1>{{result}}</h1>
    </div>
<script>
    var app=new Vue({
        el:'#app',
        watch:{
            word: _.debounce(
                function (newV,oldV) {
                    //console.log(newV+ '==>'+ oldV);
                    var data=JSON.stringify({"params":newV});
                    var url="http://192.168.13.111/YchLrestServer/api/nl/order/weixin/jsapiapp/10057/oItA9v52kZQ9sf-aiNcMsgir-89E";
                    axios.post(url,data,{
                        headers: {
                            'Content-Type': 'application/json',
                            'sessionid':'hanwuqia'
                        }
                    }).then(function (data) {
                        console.log(data.data.data);
                        app.result=data.data.data;
                    }).catch(function (error) {
                        console.log('错误'+error);
                    })
                },3000

        )


        },
        data:{
           word:'',
            result:''

        }
    });

</script>
</body>
</html>